import cloneDeep from "lodash/cloneDeep";
// eslint-disable-next-line no-unused-vars
function _grid(prop, data, div) {
  return {
    grid: {
      left: "10%",
      top: "10%",
      right: "10%",
      bottom: "10%",
    },
    legend: {
      show: false,
    },
    xAxis: {
      type: "category",
      data: data.x,
    },
    yAxis: {
      type: "value",
    },
  };
}
function bar(opt, data, prop, div) {
  let bas = _grid(prop, data, div);
  return cloneDeep(
    bas,
    {
      series: [
        {
          type: "bar",
          data: data.data,
        },
      ],
    },
    opt
  );
}
function pie(opt, data, prop, div) {
  let bas = _grid(prop, data, div);
  return cloneDeep(
    bas,
    {
      series: [
        {
          type: "pie",
          data: data.data,
        },
      ],
    },
    opt
  );
}
function line(opt, data, prop, div) {
  let bas = _grid(prop, data, div);
  return cloneDeep(
    bas,
    {
      series: [
        {
          type: "line",
          data: data.data,
        },
      ],
    },
    opt
  );
}
// eslint-disable-next-line no-unused-vars
function map(opt, data, prop, div) {}

export default {
  bar,
  line,
  pie,
};
